<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta content="telephone=no,email=no" name="format-detection" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <include file="Share:meta" />
</head>
<script type="text/javascript">
		function jsApiCall(){
			// alert('<?php echo $jsApiParameters; ?>');
			WeixinJSBridge.invoke(
				'getBrandWCPayRequest',
				{$jsApiParameters},
				function(res){
					// WeixinJSBridge.log(res.err_msg);
					// alert(res.err_code+res.err_desc+res.err_msg);
					switch(res.err_msg) {
						case 'get_brand_wcpay_request:cancel':
								 // alert('用户取消支付！');
								window.location.href="/Pay/orderPayFailure/orderno/{$info.order_no}";
								break;
						case 'get_brand_wcpay_request:fail':
								 alert('支付失败！（'+res.err_desc+'）');
								 window.location.href="/Pay/orderPayFailure/orderno/{$info.order_no}";
								break;
						case 'get_brand_wcpay_request:ok':
								 // alert('{$hash}');
								window.location.href="/Pay/orderPaySuccess?orderno={$info.order_no}&mobile={$info.shipping_mobile}";
								break;
						default:
								 // alert(JSON.stringify(res));
								window.location.href="/Pay/orderPayFailure/orderno/{$info.order_no}";
								break;
						}
				}
			);
		}

		function callpay(){
			if (typeof WeixinJSBridge == "undefined"){
					if( document.addEventListener ){
							document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
					}else if (document.attachEvent){
							document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
							document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
					}
			}else{
					jsApiCall();
			}
		}

		function showPay(){
			$("#freeCode").css("display","block");
		}

</script>

</head>
<body>
	<div id="orderList">
		<div class="header">
	        <div class="col-xs-3 textcenter">
	            <!-- <a href="/bizcard/detail/hash/{$hash}"><返回</a> -->
	        </div>
	        <div class="col-xs-6 textcenter">
	            <a href="#"><span id="titleId">订单支付</span></a>
	        </div>
	        <div class="col-xs-3 textcenter">
	        </div>
	    </div>
		<div class="container-fluid" >
			<div class="row Mob_Row_Padd_M_2 ">
				<div class="col-xs-1" style="padding-top:10px">
					<i class="fa fa-clock-o fa-lg"></i>
				</div>
	            <div class="col-xs-11">
	                感谢购买，您的订单信息已经提交<br>
	                请于2小时内完成支付，超过时限订单将自动取消
	                <br>
	                <br>
	            </div>
			</div>
			<div class="clear"></div>
			<div class="div_line"></div>
	        <div class="row Mob_Row_Padd_M_2 Bottom_line">
	            <div class="col-xs-12">
	            	<i class="fa fa-credit-card "></i>&nbsp;支付信息
	            	<br>
	            	<br>
	            </div>
	            <div class="col-xs-6">订单号:{$info.order_no}</div>
	            <div class="col-xs-6 text-right" style="color:#EB0F12">
	            	总计&yen;{$info.order_price}
	            	<br>
	            	<br>
	            </div>
	        </div>
	        <div class="clear"></div>
			<div class="div_line"></div>
			<div class="row Mob_Row_Padd_M_2 Bottom_line margin_top50">
				<div class="col-xs-12">
				<!-- <a class="btn btn-success" href="/Pay/wechat/order_no/" style="width:100%;">立即支付</a> -->
					<button type="button" class="btn btn-success" onclick="callpay();" 
	          		style="width:100%;">微信支付</button>
				</div>
			</div>
			<br/>
			<eq name="info.order_price" value="200">
				<div class="row Mob_Row_Padd_M_2 Bottom_line">
					<div class="col-xs-12">
						<button type="button" class="btn btn-warning" onclick="showPay();" 
		          		style="width:100%;">制作码支付</button>
					</div>
				</div>
				<br/>
				<div id="freeCode" class="display_none">
					<form action="/Pay/payFreeCode" method="POST" class="form-horizontal" role="form">
						<div class="row Mob_Row_Padd_M_2 Bottom_line margin_top50">
							<div class="col-xs-3">
								制作码
							</div>
							<div class="col-xs-9">
								<input type="text" name="freeCode" id="freeCode" class="form-control" value="" required="required">
								<input type="hidden" name="order_no" id="input" class="form-control" value="{$info.order_no}">
								<input type="hidden" name="order_price" id="input" class="form-control" value="{$info.order_price}">
							</div>
						</div>
						<div class="row Mob_Row_Padd_M_2">
							<div class="col-xs-12 ">
								<button type="submit" class="btn btn-success" onclick="" 
				          		style="width:100%;">确认支付</button>
							</div>
						</div>
					</form>
					
				</div>
			</eq>
		</div>
	</div>
</body>
</html>
